package com.example.network.retrofit

import com.example.network.model.App
import com.example.network.model.Data
import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.Headers
import retrofit2.http.Path
import retrofit2.http.Query

interface AppService {

    @GET("get_data.json")
    fun getAppData(): Call<List<App>>

    @GET("{page}/get_data.json")
    fun getData(@Path("page") page: Int): Call<Data>

    @GET("get_data.json")
    fun getDataWithParams(@Query("u") user: String, @Query("t") token: String): Call<Data>

    @DELETE("data/{id}")
    fun deleteData(@Path("id") id: String): Call<ResponseBody>

    @Headers("User-Agent: okhttp", "Cache-Control: max-age=0")
    @GET("get_data.json")
    fun getData(): Call<Data>

    @GET("get_data.json")
    fun getData(
        @Header("User-Agent") userAgent: String,
        @Header("Cache-Control") cacheControl: String
    ): Call<Data>

}
